﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace csharpkod
{
    public static class Class1
    {
        public static bool luhn(string pNum)
        {
            int sum = 0;
            for (int i = 0; i < pNum.Length; i++)
            {
                int temp = (pNum[i] - '0') << (1 - (i & 1));
                if (temp > 9) temp -= 9;
                sum += temp;
            }

            return (sum % 10) == 0;
        }
    }
}